package com.tuling.jucdemo.threadpool;

/**
 * @author :tangweiliang
 * @date : 2022/11/22 22:23
 * 未来的你会感谢现在努力的自己
 * run()和start()
 */
public class ThreadDemo extends Thread{
    private String name;

    public ThreadDemo(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        System.out.println(name);
    }

    public static void main(String[] args) {
        // run()和start() 虽然运行结果一样 但是线程名字不一样
       //new ThreadDemo("唐为亮").run(); //一个线程
        new ThreadDemo("唐为亮").start(); //两个线程
    }
}
